package net.oschina.app.pages;

import android.view.View;

import com.robotium.solo.Solo;

import net.oschina.app.SoloWrap;

/**
 * Created by Aaron on 2017/10/29.
 */

public class PageCommon {
    private SoloWrap soloWrap;

    public PageCommon(SoloWrap soloWrap){
        this.soloWrap = soloWrap;
    }

    public View getHomeTab(){
        return soloWrap.findById("net.oschina.app:id/nav_item_news");
    }

    public View getMonmentTab(){
        return  soloWrap.findById("net.oschina.app:id/nav_item_tweet");
    }

    public View getPublishBtn(){
        return  soloWrap.findById("net.oschina.app:id/nav_item_tweet_pub");
    }

    public View getExploreTab(){
        return  soloWrap.findById("net.oschina.app:id/nav_item_explore");
    }

    public View getMySettingsTab(){
        return  soloWrap.findById("net.oschina.app:id/nav_item_me");
    }

    public void goToHomeTab(){
        soloWrap.click(getHomeTab());
    }

    public void goToMomentTab(){
        soloWrap.click(getMonmentTab());
    }

    public void clickPublishBtn(){
        soloWrap.click(getPublishBtn());
    }

    public void goToExpolerTab(){
        soloWrap.click(getExploreTab());
    }

    public void goToMySettingsTab(){
        soloWrap.click(getMySettingsTab());
    }

    public void goBack(){
        soloWrap.goBack();
    }

    public boolean searchText(String text){
       return soloWrap.searchText(text);
    }

}
